home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / tutorials / custEducation / opengl2 / examples / accum / jitter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-11  |  4.6 KB  |  204 lines

  1. /*
  2.  * Copyright 1993, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17.  
  18. /*
  19. jitter.h
  20.  
  21. This file contains jitter point arrays for 2,3,4,8,15,24 and 66 jitters.
  22.  
  23. The arrays are named j2, j3, etc. Each element in the array has the form,
  24. for example, j8[0].x and j8[0].y
  25.  
  26. Values are floating point in the range -.5 < x < .5, -.5 < y < .5, and
  27. have a gaussian distribution around the origin.
  28.  
  29. Use these to do model jittering for scene anti-aliasing and view volume
  30. jittering for depth of field effects. Use in conjunction with the 
  31. accwindow() routine.
  32. */
  33.  
  34. typedef struct 
  35. {
  36.     float x, y;
  37. } jitter_point;
  38.  
  39. #define MAX_SAMPLES  66
  40.  
  41.  
  42. /* 2 jitter points */
  43. jitter_point j2[] =
  44. {
  45.     { 0.246490,  0.249999},
  46.     {-0.246490, -0.249999}
  47. };
  48.  
  49.  
  50. /* 3 jitter points */
  51. jitter_point j3[] =
  52. {
  53.     {-0.373411, -0.250550},
  54.     { 0.256263,  0.368119},
  55.     { 0.117148, -0.117570}
  56. };
  57.  
  58.  
  59. /* 4 jitter points */
  60. jitter_point j4[] =
  61. {
  62.     {-0.208147,  0.353730},
  63.     { 0.203849, -0.353780},
  64.     {-0.292626, -0.149945},
  65.     { 0.296924,  0.149994}
  66. };
  67.  
  68.  
  69. /* 8 jitter points */
  70. jitter_point j8[] =
  71. {
  72.     {-0.334818,  0.435331},
  73.     { 0.286438, -0.393495},
  74.     { 0.459462,  0.141540},
  75.     {-0.414498, -0.192829},
  76.     {-0.183790,  0.082102},
  77.     {-0.079263, -0.317383},
  78.     { 0.102254,  0.299133},
  79.     { 0.164216, -0.054399}
  80. };
  81.  
  82.  
  83. /* 15 jitter points */
  84. jitter_point j15[] =
  85. {
  86.     { 0.285561,  0.188437},
  87.     { 0.360176, -0.065688},
  88.     {-0.111751,  0.275019},
  89.     {-0.055918, -0.215197},
  90.     {-0.080231, -0.470965},
  91.     { 0.138721,  0.409168},
  92.     { 0.384120,  0.458500},
  93.     {-0.454968,  0.134088},
  94.     { 0.179271, -0.331196},
  95.     {-0.307049, -0.364927},
  96.     { 0.105354, -0.010099},
  97.     {-0.154180,  0.021794},
  98.     {-0.370135, -0.116425},
  99.     { 0.451636, -0.300013},
  100.     {-0.370610,  0.387504}
  101. };
  102.  
  103.  
  104. /* 24 jitter points */
  105. jitter_point j24[] =
  106. {
  107.     { 0.030245,  0.136384},
  108.     { 0.018865, -0.348867},
  109.     {-0.350114, -0.472309},
  110.     { 0.222181,  0.149524},
  111.     {-0.393670, -0.266873},
  112.     { 0.404568,  0.230436},
  113.     { 0.098381,  0.465337},
  114.     { 0.462671,  0.442116},
  115.     { 0.400373, -0.212720},
  116.     {-0.409988,  0.263345},
  117.     {-0.115878, -0.001981},
  118.     { 0.348425, -0.009237},
  119.     {-0.464016,  0.066467},
  120.     {-0.138674, -0.468006},
  121.     { 0.144932, -0.022780},
  122.     {-0.250195,  0.150161},
  123.     {-0.181400, -0.264219},
  124.     { 0.196097, -0.234139},
  125.     {-0.311082, -0.078815},
  126.     { 0.268379,  0.366778},
  127.     {-0.040601,  0.327109},
  128.     {-0.234392,  0.354659},
  129.     {-0.003102, -0.154402},
  130.     { 0.297997, -0.417965}
  131. };
  132.  
  133.  
  134. /* 66 jitter points */
  135. jitter_point j66[] =
  136. {
  137.     { 0.266377, -0.218171},
  138.     {-0.170919, -0.429368},
  139.     { 0.047356, -0.387135},
  140.     {-0.430063,  0.363413},
  141.     {-0.221638, -0.313768},
  142.     { 0.124758, -0.197109},
  143.     {-0.400021,  0.482195},
  144.     { 0.247882,  0.152010},
  145.     {-0.286709, -0.470214},
  146.     {-0.426790,  0.004977},
  147.     {-0.361249, -0.104549},
  148.     {-0.040643,  0.123453},
  149.     {-0.189296,  0.438963},
  150.     {-0.453521, -0.299889},
  151.     { 0.408216, -0.457699},
  152.     { 0.328973, -0.101914},
  153.     {-0.055540, -0.477952},
  154.     { 0.194421,  0.453510},
  155.     { 0.404051,  0.224974},
  156.     { 0.310136,  0.419700},
  157.     {-0.021743,  0.403898},
  158.     {-0.466210,  0.248839},
  159.     { 0.341369,  0.081490},
  160.     { 0.124156, -0.016859},
  161.     {-0.461321, -0.176661},
  162.     { 0.013210,  0.234401},
  163.     { 0.174258, -0.311854},
  164.     { 0.294061,  0.263364},
  165.     {-0.114836,  0.328189},
  166.     { 0.041206, -0.106205},
  167.     { 0.079227,  0.345021},
  168.     {-0.109319, -0.242380},
  169.     { 0.425005, -0.332397},
  170.     { 0.009146,  0.015098},
  171.     {-0.339084, -0.355707},
  172.     {-0.224596, -0.189548},
  173.     { 0.083475,  0.117028},
  174.     { 0.295962, -0.334699},
  175.     { 0.452998,  0.025397},
  176.     { 0.206511, -0.104668},
  177.     { 0.447544, -0.096004},
  178.     {-0.108006, -0.002471},
  179.     {-0.380810,  0.130036},
  180.     {-0.242440,  0.186934},
  181.     {-0.200363,  0.070863},
  182.     {-0.344844, -0.230814},
  183.     { 0.408660,  0.345826},
  184.     {-0.233016,  0.305203},
  185.     { 0.158475, -0.430762},
  186.     { 0.486972,  0.139163},
  187.     {-0.301610,  0.009319},
  188.     { 0.282245, -0.458671},
  189.     { 0.482046,  0.443890},
  190.     {-0.121527,  0.210223},
  191.     {-0.477606, -0.424878},
  192.     {-0.083941, -0.121440},
  193.     {-0.345773,  0.253779},
  194.     { 0.234646,  0.034549},
  195.     { 0.394102, -0.210901},
  196.     {-0.312571,  0.397656},
  197.     { 0.200906,  0.333293},
  198.     { 0.018703, -0.261792},
  199.     {-0.209349, -0.065383},
  200.     { 0.076248,  0.478538},
  201.     {-0.073036, -0.355064},
  202.     { 0.145087,  0.221726}
  203. };
  204.